<template>
  <div>
    {{ second }}秒后返回主页
  </div>
</template>
<script>
export default{
  data(){
    return{
      second:5,
      intervale:""
    }
  },
  created(){
    this.intervale = setInterval(() => {
      this.second--
      if(this.second==0){
        clearInterval(this.intervale)
        this.$router.push('/index')
      }
    }, 1000)
  }
}
</script>